<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>阳光成单系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
</head>

<body>
	<div class="x-body">
		<blockquote class="layui-elem-quote">
			<img src="./images/logo.png" class="layui-circle"
				style="width: 50px; float: left">
			<dl style="margin-left: 80px; color: #019688">
				<dt>
					<span>张三</span> <span>余额：40</span>
				</dt>
				<dd style="margin-left: 0">这家伙很懒，什么也没有留下</dd>
			</dl>
		</blockquote>
		<div class="pd-20">
			<table class="layui-table" lay-skin="line">
				<tbody>
					<tr>
						<th width="80">性别：</th>
						<td>男</td>
					</tr>
					<tr>
						<th>手机：</th>
						<td>13000000000</td>
					</tr>
					<tr>
						<th>邮箱：</th>
						<td>admin@mail.com</td>
					</tr>
					<tr>
						<th>地址：</th>
						<td>北京市 海淀区</td>
					</tr>
					<tr>
						<th>注册时间：</th>
						<td>2017-01-01</td>
					</tr>
					<tr>
						<th>积分：</th>
						<td>330</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	<script src="./lib/layui/layui.js" charset="utf-8">
        </script>
	<script src="./js/x-layui.js" charset="utf-8">
        </script>
	<script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
            
              //自定义验证规则
              form.verify({
                nikename: function(value){
                  if(value.length < 5){
                    return '昵称至少得5个字符啊';
                  }
                }
                ,pass: [/(.+){6,12}$/, '密码必须6到12位']
                ,repass: function(value){
                    if($('#L_pass').val()!=$('#L_repass').val()){
                        return '两次密码不一致';
                    }
                }
              });

              console.log(parent);
              //监听提交
              form.on('submit(add)', function(data){
                console.log(data);
                //发异步，把数据提交给php
                layer.alert("增加成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                });
                return false;
              });
              
              
            });
        </script>

</body>

</html>